<?php

/**
 * Telefono form base class.
 *
 * @method Telefono getObject() Returns the current form's model object
 *
 * @package    blackDrums
 * @subpackage form
 * @author     your name here
 */
abstract class BaseTelefonoForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idTelefono'        => new sfWidgetFormInputHidden(),
      'codigoArea'        => new sfWidgetFormInputText(),
      'numero'            => new sfWidgetFormInputText(),
      'idClienteNatural'  => new sfWidgetFormPropelChoice(array('model' => 'ClienteNatural', 'add_empty' => true)),
      'idContactoEmpresa' => new sfWidgetFormPropelChoice(array('model' => 'ContactoEmpresa', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'idTelefono'        => new sfValidatorPropelChoice(array('model' => 'Telefono', 'column' => 'idTelefono', 'required' => false)),
      'codigoArea'        => new sfValidatorNumber(),
      'numero'            => new sfValidatorNumber(),
      'idClienteNatural'  => new sfValidatorPropelChoice(array('model' => 'ClienteNatural', 'column' => 'cedula', 'required' => false)),
      'idContactoEmpresa' => new sfValidatorPropelChoice(array('model' => 'ContactoEmpresa', 'column' => 'cedula', 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('telefono[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Telefono';
  }


}
